package com.bruce.demo1.principles.demo3.dlp.demo1;

/**
 * @PROJECT_NAME design_patterns
 * @DESCRIPTION 计算机类
 * @AUTHOR CNBruceLee
 * @DATE 2021/6/21 6:46
 */
public class Computer {
    private XiJieHardDisk hardDisk;
    private KingStonMemory stonMemory;
    private InterCpu cpu;

    public XiJieHardDisk getHardDisk() {
        return hardDisk;
    }

    public void setHardDisk(XiJieHardDisk hardDisk) {
        this.hardDisk = hardDisk;
    }

    public KingStonMemory getStonMemory() {
        return stonMemory;
    }

    public void setStonMemory(KingStonMemory stonMemory) {
        this.stonMemory = stonMemory;
    }

    public InterCpu getCpu() {
        return cpu;
    }

    public void setCpu(InterCpu cpu) {
        this.cpu = cpu;
    }

    public void run() {
        System.out.println("计算机开始工作了");
        cpu.run();
        stonMemory.save();
        String data = hardDisk.get();
        System.out.println("从硬盘中获取数据：" + data);

    }
}
